import java.nio.file.Path;
import java.nio.file.Paths;

public class PartsOfPaths {
    public static void main(String[] args) {
        System.out.println(System.getProperty("os.name"));
        Path path = Paths.get("17File", "src", "PartsOfPaths.java").toAbsolutePath();
        for (int i = 0; i < path.getNameCount(); ++i) {
            System.out.println(path.getName(i));
        }
        System.out.println("end with '.java': " + path.endsWith(".java"));
        for (Path pp : path) {
            System.out.print(pp + ": ");
            System.out.print(path.startsWith(pp) + " : ");
            System.out.println(path.endsWith(pp));
        }
        System.out.println("Starts with " + path.getRoot() + " " + path.startsWith(path.getRoot()));
    }
}
